-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(astro-org): optimise and display relative content images #104
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 0ffc106 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #104 +/- ##
=======================================
Coverage 96.32% 96.32%
=======================================
Files 15 15
Lines 1822 1822
Branches 601 601
=======================================
Hits 1755 1755
Misses 66 66
Partials 1 1 ☔ View full report in Codecov by Sentry. |
@rasendubi How are you using the ids in astro? |
data: frontmatter, | ||
data: { | ||
...frontmatter, | ||
metadata: f.data.astro, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should have access into your content collection for the ids now.
...orgPlugin({ | ||
...options, | ||
uniorgPlugins, | ||
rehypePlugins: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I'm not sure what this was doing precisely. I completely escaped orgx
as I didn't understand the magic it's doing. Regardless, the rollup-plugin doesn't seem required anymore.
Hey. Sorry, for the long reply As you seem to have noticed, this PR is breaking orgx support (dumping JSX). This is used to allow users to override standard components from Astro (e.g., overriding Another example where this overriding is helpful is to override This rehype plugin might be relevant for resolving relative links (to images, other pages, and downloadable files). It searches for relative links and replaces them with imports. Probably worth adding it to |
Another note is that I just took a look and it seems that |
I haven't forgotten about this yet, I'm down to making the suggested changes, but I'm currently studying for 3 AWS Certifications after work. So, kind of locked in terms of time at the moment. Currently, this isn't a super blocker, since I have the required changes on my site, and it is working. I've also seen another possible way of handling things, using some sort of link replacement once the html is already generated. |
Que?
I'm probably breaking plenty of the cases with the semi re-write, but I found the way the plugins were being handled a bit odd. Especially, with the extra vite config and what not. As a partial result the surface api of the astro plugin has been changed during the process.
What's supported?
[[./hello.jpg]]
, make astro pick them up, and dump them in_astro
to be servedSome questions
I noticed midway through the "parsing" that current implementation was dumping jsx stringified snippets into the ast. Was this an purpose for a use-case I'm not aware of? I remember https://github.com/orgapp/orgajs had the capability to generate jsx components from org-mode.
It also was doing something hacky with regards to vite/rollup. Was it supporting a specific use-case I should be aware of?
Possibly relevant for @ispringle as well maybe?
Is this site live somewhere?
I tested this out on my own site: https://github.com/venikx/venikx.com/blob/main/src/lib/astro-org.ts (copy of astro-org source), configured via https://github.com/venikx/venikx.com/blob/main/astro.config.ts. The org-mode in question is here: https://github.com/venikx/venikx.com/blob/main/src/content/blog/handmade-hero-nixos/index.org and the site is live here: https://venikx.com/posts/handmade-hero-nixos/